<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link type="text/css" rel="stylesheet" href="./Public/Home/weixin/css/style.css" />
    <script type="text/javascript" src="./Public/Home/weixin/js/jquery.js"></script>
    <script type="text/javascript" src="./Public/Home/weixin/js/jquery.validate.min.js"></script>
    <script src="./Public/Home/weixin/js/messages_zh.js"></script>
    <script type="text/javascript">
		$(function(){
			$(".sub").click(function(){
				var cname=$("#cname").val();
				var sex =$("#sex").val();
				var tel=$("#tel").val();
				if(cname!='' && (sex=='女'||sex=='男') && (/^1[3|4|5|8][0-9]\d{4,8}$/.test(tel)) && $(".rad").is(":checked")){
					com();
				}else{
					alert("请正确填写信息");
				}
//				var color = $(".border").css("background");
//				alert(color);
//				if(color=="rgba(187,6,14)"){
//					return false;
//				}
//				else{
//					return true;
//				}
//                if
			})
			
		});
		
		function returnColor(){
			var content=$("#cname").val();
			if(content==''){
				$("#cname").css("background","#d9534f")
			}else{
				$("#cname").css("background","#5cb85c")
			}
		};
		function returnColors(){
			var sex=$("#sex").val();
            if(sex=='女'||sex=='男'){
            	$("#sex").css("background","#5cb85c")
            }
            else{$("#sex").css("background","#d9534f")}
		};
		function returnsColor(){
			var tel=$("#tel").val();
			if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(tel))){
				$("#tel").css("background","#d9534f")//红色
			}else{
				$("#tel").css("background","#5cb85c")
			}
		};
	</script>
	<style>
	.error{
		color:#EB8233;
	}
	</style>
    <title>报名</title>
</head>
<body>
	<script>
	$().ready(function() {
	    $("#commentForm").validate();
	});
        function com(){
            var name=$("#cname").val();
            var sex=$("#sex").val();
            var tel=$("#tel").val();
            var rad=$(".rad:checked").val();
            alert("报名成功");
            $.getJSON("index.php?m=Home&c=Wxin&a=comm&name="+name+"&garden="+sex+"&phone="+tel+"&is="+rad,function(result){
                window.location="http://www.rabbitpre.com/m/rAVbQnO";
            });
        }
	</script>
	<div id="box">
		<img src="./Public/Home/weixin/img/02.png" class="title" />
		<div class="cont">
			<form action="#" method="post" class="cmxform" id="commentForm">
				<input type="text" placeholder="姓名" class="border" id="cname" name="name" minlength="2"  onblur="returnColor()" value=""/>
				<input type="text" placeholder="性别" name="garden" class="border" id="sex" onblur="returnColors()" value=""/>
				<input type="tel" placeholder="手机" name="phone" class="border" onblur="returnsColor()" id="tel" value=""/>
				<p class="check">[单选] 是否报名一对一咨询</p>
				<input type="radio" name="check" class="rad" value="1"/><span class="white" >是 (限美国就诊意愿患者)</span><br />
				<input type="radio" name="check" class="rad" value="0"/><span  class="white">否</span>
				<input type="button" value="提交" class="sub"/>
			</form>
		</div><!--cont-->
		<div class="time"><p style="width: 30%; float: left; text-align: right;">活动日期：</p>
			                   <p style="width: 70%; float: left">2016年5月22日</span><span class="pdding">PM:13:30</span></p>
        </div>
		<div class="time padnone"><p style="width: 30%; float: left; text-align: right;">活动地址：</p>
			                   <p style="width: 70%; float: left">上海市浦东新区张扬路777号<br />锦江汤臣洲际大酒店</p>
       </div>
	</div>
</body>
</html>